package mode.Singleton02;

/**
 * 静态内部类单例模式，利用了今天内部类只会在被使用才会被加载的特点，
 * 从而避免了饿汉式单例模式的资源浪费，和懒汉式的线程不安全
 */
public class SingleStaticInnerClass {
    private static class SingleStaticInnerClassHolder{
        private static final SingleStaticInnerClass INSTANCE = new SingleStaticInnerClass();
    }


    private SingleStaticInnerClass(){}

    public static SingleStaticInnerClass getInstance(){
        return SingleStaticInnerClassHolder.INSTANCE;
    }


}
